<template>
  <div>
    <!-- <a-locale-provider :locale="locale"> -->
    <a-config-provider :locale="locale">
      <a-layout style="background:#fff">
        <a-layout-header>
          <Header />
        </a-layout-header>
        <Header2 />
        <a-layout-content class="wm lcontent">
          <!-- <a-row type="flex" v-if="lm">
            <LeftMenu />
            <nuxt class="nuxts" />
          </a-row>
          <nuxt v-else /> -->
          <nuxt />
        </a-layout-content>
        <a-layout-footer :style="routerlink !== '/' ? 'border-top:2px solid #f0f2f5;':''">
          <Footer class="wm" />
        </a-layout-footer>
      </a-layout>
    <!-- </a-locale-provider> -->
    </a-config-provider>
  </div>
</template>
<script>
// import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";


import enUS from 'ant-design-vue/lib/locale-provider/en_US';
import zhCN from "ant-design-vue/lib/locale-provider/zh_CN";
import moment from 'moment';
import 'moment/locale/zh-cn';

// moment.locale('zh-cn');
moment.locale('en');
export default {
  components: {
    Header: () => import("~/components/main/header"),
    Header2: () => import("~/components/main/header2"),
    LeftMenu: () => import("~/components/main/leftMenu"),
    Footer: () => import("~/components/main/footer")
  },
  data() {
    return {
      // locale: zhCN,
      routerlink: this.$route.path,
      lm: false,
      locale: zhCN,
      moment,
      enUS,
      zhCN,
    };
  },
  created() {
    let member_id = this.$token.getCookie("member_id")
    let phone = this.$token.getCookie("phone")
    if (member_id && phone) {
      this.name = phone
      this.$store.commit("cookie", {
        member_id,
        phone,
      });
    }
    this.lmSoft();
  },
  methods: {
    lmSoft() {
      let r = this.$route.path.split("/")[1];
      r == "mine" || r == "consult" ? (this.lm = true) : (this.lm = false);
    }
  },
  watch: {
    $route(to, from) {
      this.routerlink = to.path;
      this.lmSoft();
    }
  }
};
</script>
<style>
.wm {
  width: 1200px;
  margin: 0 auto;
}
.lcontent {
  background-color: #fff;
}
.ant-layout-header {
  height: 42px;
  background-color: #0084ff;
  padding: 0;
}
.ant-layout-footer {
  background-color: #fff;
}
.ant-back-top {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  right: 0;
  bottom: 0;
}
.ant-back-top-content {
  visibility: hidden;
}
.ant-layout-footer {
  margin-top: 20px;
  padding: 0;
}
.nuxts {
  width: calc(100% - 208px);
}
</style>
